import React from 'react';
import ReactDOM from 'react-dom';
import { HashRouter as Router, Route, Switch } from 'react-router-dom';
import Collect from '@/components/collect/Collect';
import Guji from '@/components/guji/Guji';
import Mingju from '@/components/mingju/Mingju';
import Shiwen from '@/components/shiwen/Shiwen';
import Tuijian from '@/components/tuijian/Tuijian';
import Zuozhe from '@/components/zuozhe/Zuozhe';
import Register from '@/components/collect/Register';
import Login from '@/components/collect/Login';
import Ipone from '@/components/Ipone';
import Sousuo from '@/components/base/sousuo';
import ShiwenDetail from '@/components/shiwen/ShiwenDetail';
import MingjuDetail from '@/components/mingju/MingjuDetail';
import * as serviceWorker from '@/serviceWorker';
import './main.scss';

ReactDOM.render(
  <Router>
    <Switch>
      <Route path='/collect' component = { Collect } />
      <Route path='/guji' component = { Guji } />
      <Route path='/mingju' component = { Mingju } />
      <Route path='/shiwen' component = { Shiwen } />
      <Route path='/tuijian' component = { Tuijian } />
      <Route path='/zuozhe' component = { Zuozhe } />
      <Route path='/Ipone' component = { Ipone } />
      <Route path='/register' component = { Register } />
      <Route path='/login' component = { Login } />
      <Route path='/Sousuo' component = { Sousuo } />
      <Route path='/shiwendetail/:id' component = { ShiwenDetail } />
      <Route path='/mingjudetail/:sid' component = { MingjuDetail } />
      <Route path='/' component = { Tuijian } />
    </Switch>
  </Router>
  , document.getElementById('root'));

//如果希望应用程序离线工作并更快地加载，可以更改
//unregister()到下面的register()。注意，这有一些陷阱。
//了解更多关于服务工作者的信息：http://bit.ly/CRA-PWA
// serviceWorker.unregister();
// 如果需要打包并且缓存的时候，改为
// serviceWorker.register();
process.env.NODE_ENV === 'production' ? serviceWorker.register() : serviceWorker.unregister()
